home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / gimp / 2.0 / plug-ins / foggify.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  2.0 KB  |  35 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from gimpfu import *
  5. import time
  6. gettext.install('gimp20-python', gimp.locale_directory, unicode = True)
  7.  
  8. def foggify(img, layer, name, colour, turbulence, opacity):
  9.     gimp.context_push()
  10.     img.undo_group_start()
  11.     if img.base_type is RGB:
  12.         type = RGBA_IMAGE
  13.     else:
  14.         type = GRAYA_IMAGE
  15.     fog = gimp.Layer(img, name, layer.width, layer.height, type, opacity, NORMAL_MODE)
  16.     fog.fill(TRANSPARENT_FILL)
  17.     img.add_layer(fog, 0)
  18.     gimp.set_background(colour)
  19.     pdb.gimp_edit_fill(fog, BACKGROUND_FILL)
  20.     mask = fog.create_mask(0)
  21.     fog.add_mask(mask)
  22.     pdb.plug_in_plasma(img, mask, int(time.time()), turbulence)
  23.     fog.remove_mask(MASK_APPLY)
  24.     img.undo_group_end()
  25.     gimp.context_pop()
  26.  
  27. register('python-fu-foggify', N_('Add a layer of fog'), 'Adds a layer of fog to the image.', 'James Henstridge', 'James Henstridge', '1999,2007', N_('_Fog...'), 'RGB*, GRAY*', [
  28.     (PF_IMAGE, 'image', 'Input image', None),
  29.     (PF_DRAWABLE, 'drawable', 'Input drawable', None),
  30.     (PF_STRING, 'name', _('_Layer name'), _('Clouds')),
  31.     (PF_COLOUR, 'colour', _('_Fog color'), (240, 180, 70)),
  32.     (PF_SLIDER, 'turbulence', _('_Turbulence'), 1, (0, 10, 0.1)),
  33.     (PF_SLIDER, 'opacity', _('Op_acity'), 100, (0, 100, 1))], [], foggify, menu = '<Image>/Filters/Render/Clouds', domain = ('gimp20-python', gimp.locale_directory))
  34. main()
  35.